import * as _ from "lodash"
import { camelCase } from "../case"
import httpClient from "../httpclient"

export class Account {
  public id: string
  public name: string
}

export class AccountServiceV1 {

  public static getAccount(id: string): Promise<Account> {
    return httpClient.get(`/v1/accounts/${id}`)
      .then(({ data }) => data)
      .then(camelCase)
      .then(data => _.assign(new Account(), data))
  }

}
